package com.joey.jvm.example.jconsole;

import lombok.extern.slf4j.Slf4j;

import java.util.ArrayList;
import java.util.List;

/**
 *
 * @Author hyy
 **/
@Slf4j
public class JConsoleExample {
    //GC首先去PS Eden Space去看对象是否存活，则赋值到Serviver Space区域。而堆内存一直处于上升趋势，因为堆内存没有垃圾回收。
//    public byte []b = new byte[128 * 1024];

    public JConsoleExample(){
        byte []b = new byte[128 * 1024];
    }


    public static void main(String[] args) throws InterruptedException {
        Thread.sleep(5000);
        log.info("Start 。。。。。。");
        fill(1000);
    }

    private static void fill(int i) {
        List<JConsoleExample> list = new ArrayList<>();
        for (int j = 0; j < i; j++) {
            try {
                Thread.sleep(100);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            list.add(new JConsoleExample());
        }
    }
}
